Adding more mo telemetry events#247
Conversation
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: PR title and empty body suggest telemetry event additions rather than kernel API or Temporal workflow changes; please confirm if this affects packages/api/cmd/api/ or packages/api/lib/temporal to opt into deploy monitoring. To monitor this PR anyway, reply with |
Schemas: - New event types: api_call (HTTP middleware), cdp_connect / cdp_disconnect (CDP proxy), live_view_connect / live_view_disconnect (Neko, producer in a follow-up). - captcha_solve_result enum trimmed to the producer-normalized vendor set (hcaptcha, recaptcha_v2, recaptcha_v3, turnstile, geetest, other). - New `api` user-toggleable category for api_call events. Producers: - chi middleware emits api_call with operationId / status / request_id / duration_ms. Disabled by default; the telemetry handler flips the package-level toggle on/off when the api category is enabled. - WebSocketProxyHandler emits cdp_connect on accept and cdp_disconnect on teardown with message_count and reason (client_close / upstream_changed / upstream_error / context_cancelled). Co-authored-by: Cursor <cursoragent@cursor.com>
| - client_close | ||
| - upstream_changed | ||
| - upstream_error | ||
| - context_cancelled |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3df164c. Configure here.

Note
Medium Risk
Adds new telemetry event types and wires them into HTTP and WebSocket proxy request paths, which may affect event volume and middleware behavior across all API calls and CDP connections. Main risk is incorrect enable/disable toggling or unexpected performance/metrics impact rather than data integrity or security logic.
Overview
Introduces a new telemetry category
apiand extends the telemetry config/handlers so it is treated as a first-class, user-togglable category (including updated all-disabled semantics and API responses).Adds request instrumentation middleware that emits
api_callevents (request id, OpenAPIoperationId, status, duration) and is dynamically enabled/disabled based on telemetry session state. The DevTools WebSocket proxy now publishescdp_connectandcdp_disconnectsystem events (including disconnect reason, duration, and relayed message count), andmain.gowires the new middleware and publisher hooks.Updates the generated OpenAPI types/spec (
oapi.go,openapi.yaml) to include the new category and event schemas, and adds/updates unit tests covering middleware emission and telemetry toggle behavior.Reviewed by Cursor Bugbot for commit 3156ff9. Bugbot is set up for automated code reviews on this repo. Configure here.